home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 051-060 / amok52 / gadgeted / txt / test1.mod < prev    next >
Text File  |  1993-11-04  |  2KB  |  55 lines

  1. (*----------------------------------------------------------------------
  2.   :Program.    Test1.mod
  3.   :Contents.   Testprogramm für GadgetEd
  4.   :Contents.   Verwendet die Struktur "Req1" in eigenem Window
  5.   :Author.     Hubert Bildstein
  6.   :Copyright.  Public Domain
  7.   :Language.   Modula-2
  8.   :Translator. M2Amiga V3.3d
  9.   :History.    V1.0   5.12.1990
  10. ----------------------------------------------------------------------*)
  11.  
  12. MODULE Test1;
  13.  
  14. FROM SYSTEM    IMPORT ADR;
  15. FROM Req1      IMPORT InitReq1,CloseReq1,GetReq1GPtr;
  16. FROM Gadgets   IMPORT WaitForGadget, DefineWindow;
  17. FROM Intuition IMPORT WindowPtr, IDCMPFlagSet, IDCMPFlags, GadgetPtr,
  18.                       NewWindow,OpenWindow,WindowFlags,WindowFlagSet,
  19.                       ScreenFlagSet,ScreenFlags;
  20. FROM InOut     IMPORT WriteInt,WriteString,WriteLn;
  21.  
  22. VAR w  : WindowPtr;
  23.     nw : NewWindow;
  24.     c  : IDCMPFlagSet;
  25.     id : INTEGER;
  26.     gp : GadgetPtr;
  27.  
  28. BEGIN
  29.  
  30.  WITH nw DO  (* eigenes Window aufbauen *)
  31.     leftEdge := 0; topEdge := 0; width := 500; height := 100;
  32.     detailPen := 0; blockPen := 1;
  33.     idcmpFlags := IDCMPFlagSet{closeWindow,gadgetUp,gadgetDown};
  34.     flags := WindowFlagSet{windowClose,windowDrag};
  35.     firstGadget := NIL; checkMark := NIL;
  36.     title := ADR("Test1");
  37.     bitMap := NIL; type := ScreenFlagSet{wbenchScreen};
  38.  END; (*WITH*)
  39.  
  40.  w := OpenWindow (nw);   (* Window eröffnen *)
  41.  
  42.  (* Gadgets in Window einbauen, verwende dabei eigenes Window *)
  43.  InitReq1 (w,NIL,NIL);
  44.  
  45.  DefineWindow (w);    (* Window für Gadgets-Modul festlegen *)
  46.  
  47.  REPEAT                          (* Auf Meldung warten und ID ausgeben *)
  48.     WaitForGadget (c,id,gp);
  49.     WriteString ("ID = "); WriteInt (id,5); WriteLn;
  50.  UNTIL (id = -1);
  51.  
  52.  CloseReq1;                          (* Window schließen *)
  53.  
  54. END Test1.
  55.